package com.jingtai.shop.webfacade.bo.shopcar;


import com.jingtai.common.webfacade.BaseBO;
import com.jingtai.common.webfacade.error.CommonException;
import com.jingtai.common.webfacade.error.ErrorEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

/**
 * 购物车列表删除逻辑传参
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class GoodsIdAndSkuBO extends BaseBO {
    /**
     * 商品ID
     */
    private String goodsId;

    /**
     * sku 编码
     */
    private String skuCode;

    @Override
    public void validate() {
        super.validate();

        if (StringUtils.isBlank(goodsId)
            || StringUtils.isBlank(skuCode)) {
            throw new CommonException(ErrorEnum.REQUIRED_PARAM_EMPTY);
        }
    }
}
